package com.usian.hero.controller;


import com.usian.hero.entity.HeroDto;
import org.springframework.stereotype.Controller;
import com.usian.hero.service.IHeroService;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-06-25
 */
@Slf4j
@RestController
@RequestMapping("hero")
public class HeroController {
@Autowired
    private IHeroService heroService;
@PostMapping("findAll")
    public List<HeroDto> findAll(@RequestBody HeroDto dto) {
     List<HeroDto> list=heroService.findAll(dto);
     return list;
}
}
